package com.story.domain;

public class Page {
	private Integer pageNum;
	private Integer pageSize;
	public Page(Integer pageNum,Integer pageSize){
		this.pageNum = pageNum;
		this.pageSize = pageSize;
	}
	/**
	 * @return the startIndex
	 */
	public Integer getStartIndex() {
		return (pageNum-1)*pageSize;
	}
	/**
	 * @return the pageNum
	 */
	public Integer getPageNum() {
		return pageNum;
	}
	/**
	 * @param pageNum the pageNum to set
	 */
	public void setPageNum(Integer pageNum) {
		if(pageNum<0){
			this.pageNum = 1;
		}else{
			this.pageNum = pageNum;
		}
		
	}
	/**
	 * @return the pageSize
	 */
	public Integer getPageSize() {
		return pageSize;
	}
	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	
}
